{% extends "base.html" %}

{% block title %}数据库{% endblock %}
{% block head %}
    {{ super() }}
    <script src="{{ url_for('static',filename='jquery/jquery-3.2.1.min.js')}}"></script>
<link rel="stylesheet" href="{{ url_for('static',filename='css/reset.css') }}">
    <link rel="stylesheet" href="{{ url_for('static',filename='css/main.css') }}">
     <script type="text/javascript" src="{{ url_for('static',filename='js/main.js') }}"></script>
     <script type="text/javascript" src="{{ url_for('static',filename='js/index.js') }}"></script>

{% endblock %}

{% block body %}
      <form class="form-inline my-2 my-lg-0" method="post" action="{{ url_for('data.search') }}" style="
        width:1200px;
        margin-left:30px;">
      <input class="form-control mr-sm-2" type="search" placeholder="关键字" aria-label="Search" name="q" style="
        width:1026px;
        height:44px;">
      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" style="
    height:44px;">搜索</button>
    </form>
     <div class="conter_con">
        <ul class="list_con fl">
           {% for news in data.news_list %}
            <li>
                <a href="#" class="news_pic fl">{{ news.index_image_url }}</a>
                <a href="#" class="news_title fl">{{  news.title}}</a>
                <a href="#" class="news_detail fl">{{  news.digest}}</a>
                <div class="author_info fl">
                    <div class="author fl">

                        <a href="#">{{news.author}}</a>
                    </div>
                    <div class="time fl">{{news.create_time}}</div>
                    <div class="polarity fl">{{ news.polarity }}</div>
                </div>
            </li>
            {% endfor %}


        </ul>
        <div class="rank_con fr">
            <div class="rank_title">
                <h3>点击排行</h3>
            </div>
           <ul class="rank_list">

                {% for news in data.news_list %}

                    {% if loop.index == 1 %}
                        <li><span class="first">{{ loop.index }}</span><a href="#">{{ news.title }}</a></li>
                    {% elif loop.index == 2 %}
                        <li><span class="second">{{ loop.index }}</span><a href="#">{{ news.title }}</a></li>
                    {% elif loop.index == 3 %}
                        <li><span class="third">{{ loop.index }}</span><a href="#">{{ news.title }}</a></li>
                    {% else %}
                        <li><span class="">{{ loop.index }}</span><a href="#">{{ news.title }}</a></li>
                    {% endif %}
            {% endfor %}
             </ul>
        </div>
    </div>
{% endblock %}